(function(){
	var pagenum=10;//每页数量
	var curpage=1;//当前页面
	var totalPage=0;//总页数
	var num = 0;//比赛奖励数量
	var arr1 = ['一','二','三','四','五','六','七','八','九','十'];
	var cnum="";//当前对阵图轮数
	var znum="";//最大对阵图轮数
	//获取下拉框类型
	function getlinklist(selectlist,selectid,type){
	   $.ajax({
			url:'http://web.icecn.net/match/getEnumInfo.json',
			type:'POST',
			async:true,
			data:{
			},
			xhrFields:{withCredentials:true},
			dataType: "json",
			success: function(data){
				dataset=data.t;
				var d=new Array();
				if(dataset && dataset.length > 0){
				   for(var i=0;i<dataset.length;i++){
					   if(dataset[i].enumType==type){
						   d.push(dataset[i])
					   }  
				   }
				   dataset=d;
				   var html = template(selectlist,{dataset:dataset});
				   $("#"+selectid).html(html);
				};
			}
	   });	
	}
	//更改赛果
	function updateResult(id,winId,troopsId){
	   $.ajax({
			url:'http://web.icecn.net/match/updateMatchResult.json',
			type:'POST',
			async:true,
			data:{
				matchId:id,
				winId:winId,
				troopsId:troopsId
			},
			dataType: "json",
			xhrFields:{withCredentials:true},
			success: function(data){
			  if(data.code==200){
				$("#modal-result").modal('hide');
				view(id,cnum)
			  }else{
				  alert(data.msg)
			  }
			}
	   });	
	}
	//查看对阵图
	function view(id,nums){
	$.ajax({
		url:'http://web.icecn.net/match/findAgainstPlan.json',
		type:'POST',
		async:true,
		data:{
			matchId:id,
			num:nums
		},
		xhrFields:{withCredentials:true},
		dataType: "json",
		success: function(data){
		   var a="";
		   if(data.t!=null){
			   var list=data.t;
			   for(var i=0;i<list.length;i++){
				   var leftName=list[i].leftName==null?"轮空":list[i].leftName;
				   var rightName=list[i].rightName==null?"轮空":list[i].rightName;
				   var leftpath=(i*2+1)
				   var rightpath=(i*2+2)
				   if(list[i].winId!=null){
					   if(list[i].winId==list[i].leftId){
						   leftpath=(i*2+1)+"(晋级)";
						   rightpath=(i*2+2)+"(淘汰)"
					   }else if(list[i].winId==list[i].rightId){
						   leftpath=(i*2+1)+"(淘汰)";
						   rightpath=(i*2+2)+"(晋级)" 
					   }else{
						   leftpath=(i*2+1)+"(淘汰)";
						   rightpath=(i*2+2)+"(淘汰)" 
					   }
				   }
				   if(cnum==znum){
				       a+="<div><ul><li data-path='"+(i*2+1)+"'><span>"+leftpath+"</span><p data-id='"+list[i].leftId+"'>"+leftName+"</p></li><li data-path='"+(i*2+2)+"'><span>"+rightpath+"</span><p data-id='"+list[i].rightId+"'>"+rightName+"</p></li></ul><label data-toggle='modal' data-target='#modal-result' data-leftId='"+list[i].leftId+"' data-rightId='"+list[i].rightId+"' class='result'>更改赛果</label></div>"}else{
					   a+="<div><ul><li data-path='"+(i*2+1)+"'><span>"+leftpath+"</span><p data-id='"+list[i].leftId+"'>"+leftName+"</p></li><li data-path='"+(i*2+2)+"'><span>"+rightpath+"</span><p data-id='"+list[i].rightId+"'>"+rightName+"</p></li></ul></div>"
					   
				   }           
			   }
			   $("#modal-view .box-primary").html(a);
			   $("#modal-view .box-title").html("第"+arr1[list[0].num-1]+"轮对阵图")
			   
			   if(cnum==""){cnum=list[0].num;znum=list[0].num;}
		   }else{
			   $("#modal-view .box-primary").html("");
		   }
		}
   });	
	}
	//重新排序
	function shuffle(arr) {
		var i, 
		j,
		temp;
		for (i = arr.length - 1; i > 0; i--) {
		j = Math.floor(Math.random() * (i + 1));
		temp = arr[i];
		arr[i] = arr[j];
		arr[j] = temp;
		}
		return arr;
	};
	//获取列表
	function getlist(curpage,pagenum){
	   var matchName=$("#matchname").val();
	   var matchId=$("#matchid").val();
	   var gameType=$("#informationType option:selected").attr("data-id")==0?"":$("#informationType option:selected").attr("data-id");
	   var gameDay=$("#matchdate").val()==0?"":$("#matchdate").val();
	   $.ajax({
			url:'http://web.icecn.net/match/findMatchList.json',
			type:'POST',
			async:true,
			data:{
				offset:pagenum*(curpage-1),
				limit:pagenum,
				matchName:matchName,
				matchId:matchId,
				gameType:gameType,
				gameDay:gameDay
				},
			xhrFields:{withCredentials:true},
			dataType: "json",
			success: function(data){
				if(data.code == 200 ){
					if(data.t!=null&&data.t!=""){
						dataset=data.t.result;
						if(dataset && dataset.length > 0){
						   for(var i=0;i<dataset.length;i++){
							  dataset[i].entryTime= getMyDate(dataset[i].entryTime);
							  dataset[i].endEntryTime= getMyDate(dataset[i].endEntryTime);
							  dataset[i].startTime= getMyDate(dataset[i].startTime);
							  switch(dataset[i].matchStatus){
								 case 1 :{
									dataset[i].matchStatus="预热" ;
									break;
								 }
								 case 2 :{
									dataset[i].matchStatus="报名中" ;
									break;
								 }
								 case 3 :{
									dataset[i].matchStatus="开赛准备" ;
									break;
								 }
								 case 4 :{
									dataset[i].matchStatus="比赛中" ;
									break;
								 }
								 case 5 :{
									dataset[i].matchStatus="比赛结束" ;
									break;
								 }
								 case 6 :{
									dataset[i].matchStatus="已取消" ;
									break;
								 }
							  }	 
							  switch(dataset[i].gameType){
								 case 1 :{
									dataset[i].gameType="王者荣耀" ;
									break;
								 }
								 case 2 :{
									dataset[i].gameType="绝地求生" ;
									break;
								 }
							  }	 
							  switch(dataset[i].matchSystem){
								 case 3 :{
									dataset[i].matchSystem="单败赛" ;
									break;
								 }
							  }	
							  switch(dataset[i].entryFeeType){
								 case 4 :{
									dataset[i].entryFeeType="钻石" ;
									break;
								 }
								 case 5 :{
									dataset[i].entryFeeType="金币" ;
									break;
								 }
							  }	  
						   }
						   var html = template('datalist',{dataset:dataset});
						   $("#example1").html(html);
						   totalPage=data.t.totalPage;
						   $(".pageinfo").html("当前"+curpage+"页/共"+totalPage+"页");
						   $(".curpage").val(curpage);
						   if(curpage==1){$(".prev").addClass("disabled")}else{$(".prev").removeClass("disabled")}
						   if(curpage==totalPage){$(".next").addClass("disabled")}else{$(".next").removeClass("disabled")}
						}
					}else{
					   $("#example1").html("<tbody><tr><td>查不到数据</td></tr></tbody>");
					};
				}
			}
	   });
	}
	var Page = {
		init:function(){
			this.render();
			this.event();
		},
		//绑定事件
		event:function(){
			//上一页
		    $(".prev").click(
			    function(){
					if(curpage>1){
				     	curpage=curpage-1;
					    getlist(curpage,pagenum);
					}
			    }
			)
			//下一页
		    $(".next").click(
			    function(){
					if(curpage<totalPage){
				     	curpage=curpage+1;
					    getlist(curpage,pagenum);
					}
			    }
			)
			//页码跳转
			$(".gopage").click(
			    function(){
					if($(".curpage").val()>=1&&$(".curpage").val()<=totalPage){
				    	curpage=parseInt($(".curpage").val());
					    getlist(curpage,pagenum)
					}else{
						$(".curpage").val(curpage);
					}
			    }
			)
			//搜索按钮
			$(".btnsearch").click(function(){
				getlist(curpage,pagenum)
			})
			
			//取消赛事
			$(".content-wrapper").on("click", '.delete', function() {
				$("#modal-delete .modal-body").attr("data-id",$(this).attr("data-matchId"))
			})
			//确认取消赛事
			$(".btndelete").click(function(){
			   var id=$("#modal-delete .modal-body").attr("data-id");
			   $.ajax({
					url:'http://web.icecn.net/match/cancelMatch.json',
					type:'POST',
					async:true,
					data:{
						matchId:id
					},
			        xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
						if(data.code === 200 ){
							$("#modal-delete").modal('hide');
							getlist(curpage,pagenum);
						}else{
						    alert("取消失败")	
						}
					}
			   });
		    })
			//添加详情图
			$(".content-wrapper").on("click", '.addimg', function() {
				$("#modal-addimg .modal-body").attr("data-id",$(this).attr("data-id"));
				$(".imgfile3").html("");
				$("#photoCover3").val("");
				$("#lefile3").val("")
			})
			//确认添加详情图
			$(".btnaddimg").click(function(){
			   var id=$("#modal-addimg .modal-body").attr("data-id");
			   var matchDetails=$("#photoCover3").val();
			   $.ajax({
					url:'http://web.icecn.net/match/updateMatch.json',
					type:'POST',
					async:true,
					data:{
						id:id,
						matchDetails:matchDetails
					},
			        xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
						if(data.code === 200 ){
							$("#modal-addimg").modal('hide');
							getlist(curpage,pagenum);
						}else{
						    alert("添加失败")	
						}
					}
			   });
		    })
			//发布对阵图
			$(".content-wrapper").on("click", '.release', function() {
				$("#modal-release .modal-body").attr("data-id",$(this).attr("data-id"))
				var id=$(this).attr("data-id");
				$.ajax({
					url:'http://web.icecn.net/match/getAgainstPlan.json',
					type:'POST',
					async:true,
					data:{
						matchId:id
					},
					xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
					   var a="";
					   if(data.t.againstPlanList!=null){
						   var list=data.t.againstPlanList;
						   for(var i=0;i<list.length;i++){
							   var rightName=list[i].rightName==null?"轮空":list[i].rightName;
							   if(rightName!="轮空"){
							    a+="<ul><li data-path='"+(i*2+1)+"' class='mli'><span>"+(i*2+1)+"</span><div><p data-toggle='modal' data-target='#modal-path' data-id='"+list[i].leftId+"'>"+list[i].leftName+"</p></div></li><li data-path='"+(i*2+2)+"' class='mli'><span>"+(i*2+2)+"</span><div><p data-toggle='modal' data-target='#modal-path' data-id='"+list[i].rightId+"'>"+rightName+"</p></div></li></ul>"             
							   }else{
								 a+="<ul><li data-path='"+(i*2+1)+"' class='mli'><span>"+(i*2+1)+"</span><div><p data-toggle='modal' data-target='#modal-path' data-id='"+list[i].leftId+"'>"+list[i].leftName+"</p></div></li><li data-path='"+(i*2+2)+"' class='mli'><span>"+(i*2+2)+"</span><div><p>"+rightName+"</p></div></li></ul>"     
							   }
						   }
						   $("#modal-release .box-primary").html(a)
						   var list2=data.t.gameDayList;
						   for(var i=0;i<list2.length;i++){
						      $(".time ul li").eq(i).addClass("bl")
							  $(".time ul li").eq(i).find("input").val(list2[i])
						   }
					   }else{
						   $("#modal-release .box-primary").html("");
						   $(".time ul li").removeClass("bl")
					   }
					}
			   });
			})
			//确认发布对阵图
			$(".btnrelease").click(function(){
				var id=$("#modal-release .modal-body").attr("data-id")
			    var gameDayList="";
				for(var i=0;i<$(".time ul li.bl").length;i++){
				  gameDayList+=""+$(".time ul li.bl").eq(i).find("input").val()+","
				}
				var againstPlanList="";
				for(var j=0;j<$("#modal-release .box.box-primary ul").length;j++){
				  var obj=new Object(); 
				  obj.leftId=$("#modal-release .box.box-primary ul").eq(j).find("li").eq(0).find("p").attr("data-id")
				  obj.leftName=$("#modal-release .box.box-primary ul").eq(j).find("li").eq(0).find("p").html()
				  obj.rightId=$("#modal-release .box.box-primary ul").eq(j).find("li").eq(1).find("p").attr("data-id")
				  obj.rightName=$("#modal-release .box.box-primary ul").eq(j).find("li").eq(1).find("p").html()
				  if(obj.rightId==null){
				     againstPlanList+="{'leftId':'"+obj.leftId+"','leftName':'"+obj.leftName+"'},"
				  }else{
					 againstPlanList+="{'leftId':'"+obj.leftId+"','leftName':'"+obj.leftName+"','rightId':'"+obj.rightId+"','rightName':'"+obj.rightName+"'}," 
				  }
				}
				againstPlanList="["+againstPlanList+"]";
				$.ajax({
					url:'http://web.icecn.net/match/createAgainstPlan.json',
					type:'POST',
					async:true,
					data:{
						matchId:id,
						AgainstPlanList:againstPlanList,
						gameDayList:gameDayList
					},
			         xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
						  $("#modal-release").modal('hide');
						  getlist(curpage,pagenum)
					}
			   });
				
			})
			//更换位置
			$(".content-wrapper").on("click", '.mli', function() {	
               $(".mpath").html($(this).attr("data-path")); 
			   $(".vpath").val("");
	        })
			//确认更换位置
			$(".btnpath").click(function(){
			   var mpath=$(".mpath").html()//当前位置
			   var vpath=$(".vpath").val();//交换位置
			   if(!$.isNumeric(vpath)||vpath=="") {alert("请输入数字");return}
			   var mhtml=$(".mli[data-path="+mpath+"]").find("div").html();
			   var vhtml=$(".mli[data-path="+vpath+"]").find("div").html();
			   if(vhtml==null||vhtml.indexOf("轮空") > 0){alert("无效位置");return}
			   $(".mli[data-path="+mpath+"]").find("div").html(vhtml);
			   $(".mli[data-path="+vpath+"]").find("div").html(mhtml);
			   $("#modal-path").modal('hide');
			})
			//重新排序
			$(".btnSort").click(function(){
			   var id=$("#modal-release .modal-body").attr("data-id");
				$.ajax({
					url:'http://web.icecn.net/match/getAgainstPlan.json',
					type:'POST',
					async:true,
					data:{
						matchId:id
					},
			        xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
					   var a="";
					   if(data.t.againstPlanList!=null){
						   var list=data.t.againstPlanList;
						   var sortlist=shuffle(list)
						   for(var i=0;i<sortlist.length;i++){
							   var rightName=list[i].rightName==null?"轮空":list[i].rightName;
							   if(rightName!="轮空"){
							    a+="<ul><li data-path='"+(i*2+1)+"' class='mli'><span>"+(i*2+1)+"</span><div><p data-toggle='modal' data-target='#modal-path' data-id='"+sortlist[i].leftId+"'>"+sortlist[i].leftName+"</p></div></li><li data-path='"+(i*2+2)+"' class='mli'><span>"+(i*2+2)+"</span><div><p data-toggle='modal' data-target='#modal-path' data-id='"+sortlist[i].rightId+"'>"+rightName+"</p></div></li></ul>"             
							   }else{
								 a+="<ul><li data-path='"+(i*2+1)+"' class='mli'><span>"+(i*2+1)+"</span><div><p data-toggle='modal' data-target='#modal-path' data-id='"+sortlist[i].leftId+"'>"+sortlist[i].leftName+"</p></div></li><li data-path='"+(i*2+2)+"' class='mli'><span>"+(i*2+2)+"</span><div><p>"+rightName+"</p></div></li></ul>"     
							   }
						   }
						   $("#modal-release .box-primary").html(a)
					   }
					}
			   });
			})
			//查看对阵图
			$(".content-wrapper").on("click", '.view', function() {
				$("#modal-view .modal-body").attr("data-id",$(this).attr("data-id"))
				var id=$(this).attr("data-id");
				cnum="";
				znum="";
				view(id,cnum)
			})
			//上一轮
			$(".numprev").click(
			    function() {
					var id=$("#modal-view .modal-body").attr("data-id")
					
					if(cnum>1){
				     	cnum=cnum-1;
					    view(id,cnum);
					}else{
					  alert("已经是第一轮")	
					}
			 })
			//下一轮
		    $(".numnext").click(
			    function(){
					var id=$("#modal-view .modal-body").attr("data-id")
					
					if(cnum<znum){
				     	cnum=cnum+1;
					    view(id,cnum);
					}else{
					  alert("已经是最后一轮")		
					}
			    }
			)
			//更改赛果
			$(".content-wrapper").on("click", '.result', function() {
			   $("#modal-result .modal-body").attr("data-leftid",$(this).attr("data-leftid"))
			   $("#modal-result .modal-body").attr("data-rightid",$(this).attr("data-rightid"))
			})
			$(".btnresult1").click(function(){
				var id=$("#modal-view .modal-body").attr("data-id");
				var lid=$("#modal-result .modal-body").attr("data-leftid");
				var rid=$("#modal-result .modal-body").attr("data-rightid");
				updateResult(id,lid,'');
			})
			$(".btnresult2").click(function(){
				var id=$("#modal-view .modal-body").attr("data-id");
				var lid=$("#modal-result .modal-body").attr("data-leftid");
				var rid=$("#modal-result .modal-body").attr("data-rightid");
				updateResult(id,rid,'');
			})
			$(".btnresult3").click(function(){
				var id=$("#modal-view .modal-body").attr("data-id");
				var lid=$("#modal-result .modal-body").attr("data-leftid");
				var rid=$("#modal-result .modal-body").attr("data-rightid");
				updateResult(id,-1,lid);
			})
			//修改按钮
			$(".content-wrapper").on("click", '.update', function() {
				var id=$(this).attr("data-id");
				$.ajax({
					url:'http://web.icecn.net/match/findMatchInfo.json',
					type:'POST',
					async:true,
					data:{
						matchId:id
					},
			        xhrFields:{withCredentials:true},
					dataType: "json",
					success: function(data){
						dataset=data.t;
						$("#id").val(id);
						$(".matchName").val(dataset.matchName)
						$("#matchSystem").val(dataset.matchSystem)
						$(".minLimit").val(dataset.minLimit)
						$("#gameType").val(dataset.gameType)
						$(".minSize").val(dataset.minSize)
						$("#serverType").val(dataset.serverType)
						$("#terraceType").val(dataset.terraceType)
						$("#entryFeeType").val(dataset.entryFeeType)
						$(".entryFee").val(dataset.entryFee)
						dataset.entryTime=getMyDate(dataset.entryTime).substring(0,10)+'T'+getMyDate(dataset.entryTime).substring(11,16);
						
						dataset.endEntryTime=getMyDate(dataset.endEntryTime).substring(0,10)+'T'+getMyDate(dataset.endEntryTime).substring(11,16);
						
						dataset.startTime=getMyDate(dataset.startTime).substring(0,10)+'T'+getMyDate(dataset.startTime).substring(11,16);
						
						$(".entryTime").val(dataset.entryTime)
						$(".endEntryTime").val(dataset.endEntryTime)
						$(".startTime").val(dataset.startTime)
						$(".matchPic").val(dataset.matchPic)
						$(".matchPoster").val(dataset.matchPoster)
						$(".isStick").val(dataset.isStick)
						CKEDITOR.instances.editor1.setData(dataset.matchIntroduce)
						$(".imgfile1").html(dataset.matchPic!=null?"<img src='"+dataset.matchPic+"'/>":"")	
						$(".imgfile2").html(dataset.matchPoster!=null?"<img src='"+dataset.matchPoster+"'/>":"")	
						$(".gameDay input").attr("checked", false)
						var gameDay=dataset.gameDay.split(",");
						for(var i=0;i<gameDay.length;i++){
						  $(".gameDay input").eq(gameDay[i]-1).attr("checked", true)
						}
						$(".isStick").val(dataset.isStick)
						$('.reward div').remove()
						$('.reward .mp').after("<div></div>")
						var matchPrize=dataset.matchPrize;
						if(matchPrize.length>0){
						  num=matchPrize.length;
					      for(var i=0;i<matchPrize.length;i++){
							$('.reward>div:last-of-type').after('<div>' + 
								  '<label data-id='+matchPrize[i].id+'>'+matchPrize[i].ranking+'</label>'+
								  '<select class="form-control w180 mr5">'+
									'<option>钻石</option><option>金币</option>'+
								  '</select>'+
								  '<input type="text" class="form-control w180" placeholder="数量" value='+matchPrize[i].awardContent+'></div>'
							);
							$('.reward>div').eq(i+1).find("select").val(matchPrize[i].awardType)
						  }
						}else{
						  num=0;
						}
					}
			   });
			})
			//确认修改
			$('.submit').click(function(){
				var id=$("#id").val()
				var matchSystem = $('.matchSystem option:selected').val();
				var gameType = $('.gameType option:selected').val();
				var serverType = $('.serverType option:selected').val();
				var terraceType = $('.terraceType option:selected').val();
				var entryFeeType = $('.entryFeeType option:selected').val();
				var matchName = $('.matchName').val();
				var minLimit = $('.minLimit').val();
				var minSize = $('.minSize').val();
				var entryFee = $('.entryFee').val();
				var entryTime = $('.entryTime').val().substring(0,10)+' '+$('.entryTime').val().substring(11)+':00';
				var endEntryTime = $('.endEntryTime').val().substring(0,10)+' '+$('.endEntryTime').val().substring(11)+':00';
				var startTime = $('.startTime').val().substring(0,10)+' '+$('.startTime').val().substring(11)+':00';
				var matchPic = $('.matchPic').val();
				var matchPoster = $('.matchPoster').val();
				var isStick = $('.isStick').val();
				var matchIntroduce = CKEDITOR.instances.editor1.getData();
				var gameDay = [];
				for(i = 0; i < $('.gameDay>input:checkbox:checked').length; i++){
					var val = $('.gameDay>input:checkbox:checked').eq(i).val();
					gameDay.push(val);
				};
				var matchPrize = "";
				for(i = 1; i < $('.matchPrize>div').length; i++){
					var id1=$('.matchPrize>div').eq(i).find('label').attr("data-id")==null?"":$('.matchPrize>div').eq(i).find('label').attr("data-id");
					var label1 = $('.matchPrize>div').eq(i).find('label').html();
					var select1 = $('.matchPrize>div').eq(i).find('select').val();
					var input1 = $('.matchPrize>div').eq(i).find('input').val();
					matchPrize+="{'id':'"+id1+"','ranking':'"+label1+"','awardType':'"+select1+"','awardContent':'"+input1+"'},"
				};
				matchPrize="["+matchPrize+"]";
				if(matchName==""){alert("赛事名称不能为空");return}
				var data = {
					id:id,
					matchName:matchName,
					matchSystem:matchSystem,
					minLimit:minLimit,
					gameType:gameType,
					minSize:minSize,
					serverType:serverType,
					terraceType:terraceType,
					entryFee:entryFee,
					entryTime:entryTime,
					startTime:startTime,
					endEntryTime:endEntryTime,
					gameDay:gameDay.join(','),
					matchPic:matchPic,
					matchPoster:matchPoster,
					matchIntroduce:matchIntroduce,
					matchPrize:matchPrize,
					entryFeeType:entryFeeType,
					isStick:isStick
				};
				$.ajax({
					url:'http://web.icecn.net/match/updateMatch.json',
					type:'POST',
					async:true,
					data:data,
					dataType:'json',
		        	xhrFields:{withCredentials:true},
					success:function(data){
					  if(data.code==200){
						  $("#modal-addupdate").modal('hide');
						  getlist(curpage,pagenum)
					  }else{
						alert(data.msg);  }
					}
				});
			});
			//增加比赛奖励
			$('.plus').click(function(){
				if(num<=9){
					num1 = arr1[num];
				};
				$('.reward>div:last-of-type').after('<div>' + 
					  '<label>第' + num1 + '名</label>'+
					  '<select class="form-control w180 mr5">'+
						'<option>钻石</option><option>金币</option>'+
					  '</select>'+
					  '<input type="text" class="form-control w180" placeholder="数量"></div>'
				);
				num++;
			});
		},
		//渲染页面
		render:function(){
			getlist(curpage,pagenum)
			getlinklist("selectlist","informationType",2);
			getlinklist("selectlist2","matchSystem",1);
			getlinklist("selectlist2","gameType",2);
			getlinklist("selectlist2","serverType",5);
			getlinklist("selectlist2","terraceType",6);
			getlinklist("selectlist2","entryFeeType",3);
		}
	};
	Page.init();
})();